// default package
// Generated 28 Jul, 2014 8:04:07 PM by Hibernate Tools 3.4.0.CR1
package com.galaxy.bean;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * SalesPaymentTransaction generated by hbm2java
 */
@Entity
@Table(name = "sales_payment_transaction", catalog = "magento", uniqueConstraints = @UniqueConstraint(columnNames = {
		"order_id", "payment_id", "txn_id" }))
public class SalesPaymentTransaction implements java.io.Serializable {

	private Integer transactionId;
	private SalesFlatOrder salesFlatOrder;
	private SalesFlatOrderPayment salesFlatOrderPayment;
	private SalesPaymentTransaction salesPaymentTransaction;
	private String txnId;
	private String parentTxnId;
	private String txnType;
	private short isClosed;
	private byte[] additionalInformation;
	private Date createdAt;
	private Set salesPaymentTransactions = new HashSet(0);

	public SalesPaymentTransaction() {
	}

	public SalesPaymentTransaction(SalesFlatOrder salesFlatOrder,
			SalesFlatOrderPayment salesFlatOrderPayment, short isClosed) {
		this.salesFlatOrder = salesFlatOrder;
		this.salesFlatOrderPayment = salesFlatOrderPayment;
		this.isClosed = isClosed;
	}

	public SalesPaymentTransaction(SalesFlatOrder salesFlatOrder,
			SalesFlatOrderPayment salesFlatOrderPayment,
			SalesPaymentTransaction salesPaymentTransaction, String txnId,
			String parentTxnId, String txnType, short isClosed,
			byte[] additionalInformation, Date createdAt,
			Set salesPaymentTransactions) {
		this.salesFlatOrder = salesFlatOrder;
		this.salesFlatOrderPayment = salesFlatOrderPayment;
		this.salesPaymentTransaction = salesPaymentTransaction;
		this.txnId = txnId;
		this.parentTxnId = parentTxnId;
		this.txnType = txnType;
		this.isClosed = isClosed;
		this.additionalInformation = additionalInformation;
		this.createdAt = createdAt;
		this.salesPaymentTransactions = salesPaymentTransactions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "transaction_id", unique = true, nullable = false)
	public Integer getTransactionId() {
		return this.transactionId;
	}

	public void setTransactionId(Integer transactionId) {
		this.transactionId = transactionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "order_id", nullable = false)
	public SalesFlatOrder getSalesFlatOrder() {
		return this.salesFlatOrder;
	}

	public void setSalesFlatOrder(SalesFlatOrder salesFlatOrder) {
		this.salesFlatOrder = salesFlatOrder;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "payment_id", nullable = false)
	public SalesFlatOrderPayment getSalesFlatOrderPayment() {
		return this.salesFlatOrderPayment;
	}

	public void setSalesFlatOrderPayment(
			SalesFlatOrderPayment salesFlatOrderPayment) {
		this.salesFlatOrderPayment = salesFlatOrderPayment;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parent_id")
	public SalesPaymentTransaction getSalesPaymentTransaction() {
		return this.salesPaymentTransaction;
	}

	public void setSalesPaymentTransaction(
			SalesPaymentTransaction salesPaymentTransaction) {
		this.salesPaymentTransaction = salesPaymentTransaction;
	}

	@Column(name = "txn_id", length = 100)
	public String getTxnId() {
		return this.txnId;
	}

	public void setTxnId(String txnId) {
		this.txnId = txnId;
	}

	@Column(name = "parent_txn_id", length = 100)
	public String getParentTxnId() {
		return this.parentTxnId;
	}

	public void setParentTxnId(String parentTxnId) {
		this.parentTxnId = parentTxnId;
	}

	@Column(name = "txn_type", length = 15)
	public String getTxnType() {
		return this.txnType;
	}

	public void setTxnType(String txnType) {
		this.txnType = txnType;
	}

	@Column(name = "is_closed", nullable = false)
	public short getIsClosed() {
		return this.isClosed;
	}

	public void setIsClosed(short isClosed) {
		this.isClosed = isClosed;
	}

	@Column(name = "additional_information")
	public byte[] getAdditionalInformation() {
		return this.additionalInformation;
	}

	public void setAdditionalInformation(byte[] additionalInformation) {
		this.additionalInformation = additionalInformation;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_at", length = 19)
	public Date getCreatedAt() {
		return this.createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "salesPaymentTransaction")
	public Set getSalesPaymentTransactions() {
		return this.salesPaymentTransactions;
	}

	public void setSalesPaymentTransactions(Set salesPaymentTransactions) {
		this.salesPaymentTransactions = salesPaymentTransactions;
	}

}
